#ifndef FormDrugQuery_H
#define FormDrugQuery_H

#include <QWidget>
#include <QSqlQuery>
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QSqlQueryModel>
#include <QLibrary>
#include <QLineEdit>
#include <QFocusEvent>

//#include "windows.h"


QT_BEGIN_NAMESPACE
namespace Ui { class FormDrugQuery; }
QT_END_NAMESPACE


class FormDrugQuery : public QWidget
{
    Q_OBJECT

public:
    FormDrugQuery(QWidget *parent = nullptr);
    ~FormDrugQuery();
    void setState();

private slots:
    void closeEvent(QCloseEvent *event);
    void on_pushButton_clicked();
    void on_pushButton_2_clicked();
    void on_rbSingle_clicked();
    void on_tbId_doubleClicked(const QModelIndex &index);
    void on_dtStart_dateChanged(const QDate &date);
    void on_cbSingleDay_clicked();
    void on_rbCurrentDay_clicked();
    void on_rbSelfMade_clicked();
    void on_rbAll_clicked();
    //void on_ckConsume_clicked();
    void on_rbKc_clicked();
    void on_rbKcxh_clicked();
    void on_rbCftj_clicked();

    void on_rbHang_clicked();

    void on_tbId_clicked(const QModelIndex &index);

    void on_cbBalanced_clicked();

    void on_tbDetail_doubleClicked(const QModelIndex &index);

signals:
    void btSearchPressed();
    void destroyW( QString);

private:
    Ui::FormDrugQuery *ui;
    QSqlQuery qr, qr0;
    QSqlQueryModel md ;
    QSqlQueryModel mdRecal ;
    QString sq;
    QString tstN;
    QString rName,rSex,rBirth,rId,rAge;//read from identityCardReader

    bool haveCardReader,cardReaded;
};
#endif // FormDrugQuery_H
